<template>
	<div>
		<el-radio-group v-model="labelPosition">
			<el-row>
				<el-col :span="12" v-for="(item, index) in options" :key="index">
					<div class="grid-content bg-purple-dark">
						<el-radio-button :label="index">{{ item.name }}</el-radio-button>
					</div>
				</el-col>
			</el-row>
			<el-form :inline="true" :model="formatForm" class="demo-form-inline" label-position="right"
				label-width="300px">
				<el-form-item :label="item.label" v-for="(item, index) in formatForm" :key="index">
					<el-select v-if="item.type=='select'" v-model="formData[item.label]" placeholder="请选择">
						<el-option :label="i.label" :value="i.value" v-for="(i, j) in item.options" :key="j">
						</el-option>
					</el-select>
					<el-input v-else-if="item.type=='input'" v-model="formData[item.label]"></el-input>
				</el-form-item>
			</el-form>
		</el-radio-group>
		<el-button @click="$emit('saved')" style="float: right" type="primary">确定</el-button>
	</div>
</template>
<script lang="ts" setup>
	import {
		ref
	} from "vue";
	const formData = ref({

	})
	const labelPosition = ref(1);
	const options = ref([{
			name: '所有文件在一个进程中打开',
		},
		{
			name: '打开文件',
		},
		{
			name: '打开文件后自动隐藏没有变位的开关量通道',
		},
		{
			name: '打开文件后优先显示开关量通道',
		},
		{
			name: '打开文件后优先显示通道名',
		},
		{
			name: '自动保存波形视图状态',
		},
		{
			name: '启用相应补偿',
		},
		{
			name: '时间等轴比展示',
		}
	]);
	const formatForm = ref([
		{
			type: 'select',
			label: '开关量相对时间格式',
			options: [{
					label: 'ms.us',
					value: 1
				},
				{
					label: 'mm: ss.us',
					value: 2
				},
			]
		},
		{
			type: 'select',
			label: '开关量相对参考点',
			options: [{
					label: '用户指定零时刻(T0‘)',
					value: 1
				},
				{
					label: '录波触发时刻(T0)',
					value: 2
				},
				{
					label: '当前T1光标时刻(动态)',
					value: 3
				},
				{
					label: '当前T1光标时刻(固态)',
					value: 4
				},
			]
		},
		{
			type: 'select',
			label: 'DFT数据窗口模式',
			options: [{
					label: '向前计算一周波',
					value: 1
				},
				{
					label: '向两侧各计算半周波',
					value: 2
				},
				{
					label: '向后计算一周波',
					value: 3
				},
			]
		},
		{
			type: 'input',
			label: '开关量通道滤波最小宽度',
		},
		{
			type: 'select',
			label: 'Language',
			options: [{
					label: '简体中文',
					value: 1
				},
				{
					label: 'English',
					value: 2
				},
			]
		},
	])
</script>
